# Copyright (c) Facebook, Inc. and its affiliates.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#
# build pytorch:1.9.0-cuda11.1-cudnn7-runtime
#
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ai.internal/library/pytorch:1.9.0-cuda11.1-cudnn7-runtime

RUN apt-get update && apt-get install -y git vim

ENV PATH=/root/.local/bin:$PATH

#RUN pip install --user transformers torchtext pandas sklearn

RUN mkdir -p /workspace/bert/src/

RUN mkdir -p /workspace/bert/checkpoint/

RUN mkdir -p /workspace/data/

RUN mkdir -p /workspace/dataset/bert/

#wget http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-images-idx3-ubyte.gz, not needed, it is for mnist
#ADD train-images-idx3-ubyte.gz /workspace/dataset/bert/train-images-idx3-ubyte.gz

#wget https://s3.amazonaws.com/fast-ai-nlp/ag_news_csv.tgz unzip and zip inside
#tar -xzvf ag_news_csv.tgz
#cd ag_news_csv
#tar -czvf ag_news_csv.tgz * --exclude ag_news_csv.tgz
ADD ag_news_csv.tgz /workspace/data

ADD ag_news_csv.tgz /workspace/data/AG_NEWS

#wget https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt
ADD bert-base-uncased-vocab.txt /workspace/bert/bert-base-uncased-vocab.txt

#wget https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased.tar.gz
ADD bert-base-uncased.tar.gz /workspace/data/bert-base-uncased


ADD bert.py /workspace/bert/src/bert.py

ENTRYPOINT ["python", "/workspace/bert/src/bert.py"]
